package com.atguigu.lease.common.exception;

import com.atguigu.lease.common.result.ResultCodeEnum;
import lombok.Data;

@Data
public class UsernameIsDuplicated extends RuntimeException {
    private Integer code;
    public UsernameIsDuplicated(Integer code,String message){
        super(message);
        this.code = code;
    }
    public UsernameIsDuplicated(ResultCodeEnum e){
        this(e.getCode(),e.getMessage());
    }
     @Override
    public String toString() {
        return "UsernameIsDuplicated{" +
                "code=" + code +
                ", message=" + this.getMessage() +
                '}';
    }
}
